<template>
  <div>
      <h1 v-text="msg" ref="title"></h1>
      <button @click="showDOM" ref="btn">点我输出上方的DOM元素</button>
      <School ref="sch"/>
  </div>
</template>

<script>
import School from './componets/school.vue'
export default {
    name:'App',
    components:{School},
    data() {
      return {
        msg:'欢迎666'
      }
    },
    methods:{
      showDOM() {
        console.log(this.$refs.title); //真实DOM
        console.log(this.$refs.btn); //真实DOM
        console.log(this.$refs.sch); //组件实例对象 (vc)
      }
    }
}
</script>
